package testing.setTest;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

class Product
{
	private Long uuid;
	private String name ;
	
	public Long getUuid() {
		return uuid;
	}
	public void setUuid(Long uuid) {
		this.uuid = uuid;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Product(Long uuid, String name)
	{
		this.uuid=uuid ;
		this.name=name ;
	}
	 public boolean equals(Object p) {
		if(this.getUuid().equals(((Product)p).getUuid()))
		{
			return true;
		}
		return false;	
	}
	public int hashCode() {
		return "product".length();
	} 
}
class Category
{
}
public class SetTest {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Set<Product> pSet = new HashSet<Product>();
		Product p1 = new Product(1L,"vineet");
		Product p2 = new Product(2L,"saxena");
		Product p3 = new Product(1L,"tiwari");
		Product p4 = new Product(2L,"ddd");
		pSet.add(p1);
		pSet.add(p2);
		pSet.add(p3);
		pSet.add(p4);
		Iterator<Product> pItr=pSet.iterator();
		System.out.println(pSet.size());
	}

}
